# File: type.py

def load(file):
    if isinstance(file, type("")):
        file = open(file, "rb")
    return file.read()

print len(load("sample.jpg")), "bytes"
print len(load(open("sample.jpg", "rb"))), "bytes"